import 'package:flutter/material.dart';
import 'package:im_module/common/time_message.dart';
import 'package:tencent_im_sdk_plugin/models/v2_tim_message.dart';

///系统消息主体
// ignore: must_be_immutable
class SystemMessageBody extends StatelessWidget {
  V2TimMessage v2timMessage;

  SystemMessageBody(this.v2timMessage);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        padding: EdgeInsets.all(10),
        child: Column(
          children: [
            Text("${MessageTimeUtils.getMessageTime(v2timMessage.timestamp!)}"),
            SizedBox(
              height: 10,
            ),
            Container(
              margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
              padding: EdgeInsets.all(10),
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(8)),
                  color: Colors.white),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "这个是标题",
                    style: TextStyle(fontSize: 16, color: Color(0xff000000)),
                  ),
                  SizedBox(
                    height: 15,
                  ),
                  Text(
                    "${v2timMessage.customElem?.data}",
                    //"kwjkwqjeqjwejqlweklqjelqjweljqklejklqejqwek",
                    style: TextStyle(fontSize: 14, color: Color(0xff666666)),
                  ),
                ],
              ),
              //child: Text("kwjkwqjeqjwejqlweklqjelqjweljqklejklqejqwek"),
            )
          ],
        ),
      ),
    );
  }
}
